<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="robots" content="noindex,nofollow" />
		<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
		<link rel="stylesheet" href="__CSS__/common.css" media="all">
	</head>

	<body class="page-body">
		<h2 class="comm-title">认证</h2>
		
		<div class="tpcms-body-div page-main">
			<form class="layui-form new-form" id="admin">
				<div class="layui-form-item">
					<label class="layui-form-label">真实姓名</label>
					<div class="layui-input-block">
						<input type="text" name="username" value="{$user_info.real_name}"  lay-verify="required" readonly="" placeholder="" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">身份证</label>
					<div class="layui-input-block">
						<input type="text" name="username" value="{$user_info.card}"  lay-verify="required" readonly="" placeholder="" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">户籍</label>
					<div class="layui-input-block">
						<input type="text" name="username" value="{$user_info.huji}"  lay-verify="required" readonly="" placeholder="" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">工种</label>
					<div class="layui-input-block">
						<input type="text" name="username" value="{$type_name}"  lay-verify="required" readonly="" placeholder="" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button type="button" class="layui-btn new-btn-style" lay-submit lay-filter="admin">通过</button>
						<button type="button" class="layui-btn new-btn-style" lay-submit lay-filter="badmin">不通过</button>
						<!-- <button type="reset" class="layui-btn layui-btn-primary default-btn">重置</button> -->
					</div>
				</div>

			</form>


			<script src="__PUBLIC__/layui/layui.js"></script>
			<script src="__PUBLIC__/jquery/jquery.min.js"></script>

			<script>
				layui.use(['layer', 'form', 'layedit', 'upload'], function() {
					var layer = layui.layer,
						$ = layui.jquery,
						form = layui.form;
					
					form.on('submit(admin)', function(data) {
						
						$.ajax({
							url: "{:url('renzheng')}",
							data: {audit_status:2,id:"{$user_info.id}"},
							type: 'post',
							success: function(res) {
								if (res.code == 0) {
									layer.msg(res.message, {
										offset: '15px',
										icon: 1,
										time: 1000
									}, function() {
										window.parent.location.reload();
										varindex = parent.layer.getFrameIndex(window.name);
										parent.layer.close(index);
									});
								} else {
									layer.msg(res.message, {
										offset: '15px',
										icon: 2,
										time: 1000
									});
								}
							}
						})
						return false;
					});
					
					form.on('submit(badmin)', function(data) {
						
						$.ajax({
							url: "{:url('renzheng')}",
							data: {audit_status:0,id:"{$user_info.id}"},
							type: 'post',
							success: function(res) {
								if (res.code == 0) {
									layer.msg(res.message, {
										offset: '15px',
										icon: 1,
										time: 1000
									}, function() {
										window.parent.location.reload();
										varindex = parent.layer.getFrameIndex(window.name);
										parent.layer.close(index);
									});
								} else {
									layer.msg(res.message, {
										offset: '15px',
										icon: 2,
										time: 1000
									});
								}
							}
						})
						return false;
					});
				});
			</script>
		</div>
	</body>

</html>
